package org.flexlancer.databases
{
	import flash.events.EventDispatcher;
	import flash.events.IEventDispatcher;

	public class VehicleInfo extends EventDispatcher
	{
		private static const TABLE:String = "vehicleinfo";
		public function VehicleInfo(target:IEventDispatcher=null)
		{
			super(target);
		}
		public static function List(condition:String = ""):Array{
			try{
				return DatabaseManager.Manager.Select(TABLE,null,condition);
			}catch(err:Error){
				throw err;
			}
			return new Array();
		}
		public static function Add(infos:Array ):void{
			try{
				for each ( var singleVehicle:Object in infos ){
					DatabaseManager.Manager.Insert(TABLE,singleVehicle);
				}
			}catch(err:Error){
				throw err;
			}
		}
		public static function Delete(condition:String=""):void{
			try{
				DatabaseManager.Manager.Delete(TABLE,condition);
			}catch(err:Error){
				throw err;
			}
		}
	}
}